home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / C64 / B-Business / (c)b2.d64 / memoranda.c (.txt) < prev    next >
Commodore BASIC  |  2007-02-04  |  6KB  |  163 lines

  1. 10 DIMYF(99),TF$(99),MF(99),DF(99),T$(99),M(11),M$(11),DM(11):PRINTCHR$(142)
  2. 20 FORI=0TO11:READM$(I),M(I):NEXT:DATAJAN,0,FEB,31,MAR,59,APR,90,MAY,120
  3. 25 FORI=0TO11:READDM(I):NEXT
  4. 30 DATAJUN,151,JUL,181,AUG,212,SEP,243,OCT,273,NOV,304,DEC,334
  5. 35 DATA31,28,31,30,31,30,31,31,30,31,30,31
  6. 40 POKE53280,1:POKE53281,1
  7. 50 PRINT"[147][170][205]  [206][180][207][183][183][170][205]  [206][180][206][183][205] [207][183][205] [206][183][205][170][205]  [180][207][183][205] [206][183][205]"
  8. 60 PRINT"[170] [205][206] [180][180]  [170] [205][206] [180][180] [170] [180] [170] [180] [170][170] [205] [180][180] [170] [180] [170]"
  9. 70 PRINT"[170]    [180][207][183] [170]    [180][180] [170] [204][175][206] [204][175][186][170]  [205][180][180] [170] [204][175][186]"
  10. 80 PRINT"[170]    [180][204][175][175][170]    [180][205][175][206] [180] [205] [180] [170][170]   [180][204][175][206] [180] [170]"
  11. 90 PRINTTAB(11);"ENTER TODAY'S DATE":INPUT"       YYYY,MM,DD ";Y0,M0,D0
  12. 100 IFY0<1983ORM0<1ORM0>12ORY0<>INT(Y0)ORM0<>INT(M0)ORD0<>INT(D0)ORD0<1THEN50
  13. 110 LY=0:IFY0/4=INT(Y0/4)ANDY0/100<>INT(Y0/100)THENLY=1
  14. 120 IFY0/400=INT(Y0/400)THENLY=1
  15. 130 IFD0>DM(M0-1)ANDM0<>2THEN50
  16. 140 IFD0>DM(M0-1)+LYTHEN50
  17. 150 DY=M(M0-1)+D0:IFM0>2THENDY=DY+LY
  18. 151 CY=0:L0=DY:L1=L0:H0=DY+14:H1=H0:IFH0<=365+LYTHEN155
  19. 152 H0=365+LY:L1=0:H1=DY+14-365-LY:CY=1
  20. 155 GOTO880
  21. 160 PRINT"[147][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]":FORI9=1TO21:PRINT"[145][221]";SPC(38);"[221]"
  22. 170 NEXT:PRINT"[145][202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]"
  23. 180 PRINT"[171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]":RETURN
  24. 190 GOSUB160
  25. 200 PRINTTAB(13);"[145][144]COMMAND MENU"
  26. 210 PRINTTAB(3);"1 - LIST UPCOMING BIRTHDAYS"
  27. 220 PRINTTAB(3);"2 - LIST UPCOMING ANNIVERSARIES"
  28. 230 PRINTTAB(3);"3 - LIST UPCOMING APPOINTMENTS"
  29. 240 PRINTTAB(3);"4 - UPDATE BIRTHDAY FILE"
  30. 250 PRINTTAB(3);"5 - UPDATE ANNIVERSARY FILE"
  31. 260 PRINTTAB(3);"6 - UPDATE APPOINTMENT FILE"
  32. 270 PRINTTAB(3);"_ - EXIT PROGRAM"
  33. 280 PRINTTAB(3);"ENTER YOUR COMMAND"
  34. 290 GETA$:IFA$=""THEN290
  35. 300 IFA$="_"THEN970:REM SAVE FILE AND END
  36. 310 IFA$="1"THEN1000:REM LIST BIRTHDAYS
  37. 320 IFA$="2"THEN2000:REM LIST ANNIVERSARIES
  38. 330 IFA$="3"THEN3000:REM LIST APPOINTMENTS
  39. 340 IFA$="4"THEN4000:REM UPDATE BIRTHDAYS
  40. 350 IFA$="5"THEN5000:REM UPDATE ANNIVERSARIES
  41. 360 IFA$="6"THEN6000:REM UPDATE APPOINTMENTS
  42. 370 GOTO290
  43. 380 INPUT#15,E0,E$,E1,E2:EF=0:IFE0>19THENEF=1
  44. 390 RETURN
  45. 400 PRINT" PRESS SPACE[146] TO CONTINUE"
  46. 410 GETA$:IFA$<>" "THEN410
  47. 420 RETURN
  48. 430 PRINTTAB(10);"[144][145]UPCOMING BIRTHDAYS":RETURN
  49. 440 PRINTTAB(8);"[144][145]UPCOMING ANNIVERSARIES":RETURN
  50. 450 PRINTTAB(8);"[144][145]UPCOMING APPOINTMENTS":RETURN
  51. 460 PRINT"[147]";E0;" ";E$;E1;E2:CLOSE2:CLOSE15:END
  52. 470 PRINT" PRESS SPACE[146] FOR MENU"
  53. 480 GOSUB410:GOTO190
  54. 510 P$=M$(M-1)+STR$(D):IFDN=>L1ANDDN<=H1THENY=Y-CY
  55. 520 IFLEN(P$)<7THENP$=P$+" ":GOTO520
  56. 530 P$=P$+"-"+STR$(Y0-Y):DN=VAL(RIGHT$(P$,1)):DY=Y0-Y
  57. 540 IFDN=1AND(DY<10ORDY>20)THENP$=P$+"ST":GOTO580
  58. 550 IFDN=2AND(DY<10ORDY>20)THENP$=P$+"ND":GOTO580
  59. 560 IFDN=3AND(DY<10ORDY>20)THENP$=P$+"RD":GOTO580
  60. 570 P$=P$+"TH"
  61. 580 IFLEN(P$)<15THENP$=P$+" ":GOTO580
  62. 590 P$=P$+"- "+N$:IFLEN(P$)>35THENP$=LEFT$(P$,35)
  63. 600 RETURN
  64. 610 PRINT"[147][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]"
  65. 620 PRINT"[145][221]  R - RETAIN RECORD AS IS             [221]"
  66. 630 PRINT"[145][221]  D - DELETE RECORD                   [221]"
  67. 640 PRINT"[145][221]  U - UPDATE RECORD AND SAVE          [221]"
  68. 650 PRINT"[145][202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]"
  69. 660 RETURN
  70. 670 GETA$:IFA$<>"R"ANDA$<>"D"ANDA$<>"U"THEN670
  71. 675 RETURN
  72. 680 IFA$="R"THEN4120
  73. 690 IFA$="D"THEN4090
  74. 695 GOTO4125
  75. 700 PRINT"[147][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]"
  76. 710 PRINT"[145][221]                                      [221]"
  77. 720 PRINT"[145][221]  INPUT UPDATED DATA OR PRESS RETURN[146]  [221]"
  78. 730 PRINT"[145][221]                                      [221]"
  79. 740 PRINT"[145][202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]"
  80. 750 RETURN
  81. 760 PRINT"[147]END OF EXISTING RECORDS."
  82. 770 PRINT"DO YOU WISH TO ADD NEW RECORDS (Y/N)?"
  83. 780 GETA$:IFA$<>"Y"ANDA$<>"N"THEN780
  84. 790 IFA$="Y"THEN4200
  85. 800 GOTO190
  86. 820 PRINT"[147][213][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][201]"
  87. 830 PRINT"[145][221]                                      [221]"
  88. 840 PRINT"[145][221]  INPUT NEW RECORDS AS PROMPTED       [221]"
  89. 850 PRINT"[145][221]                                      [221]"
  90. 851 PRINT"[145][221]  ENTER Y,M & D AS NUMBERS ONLY       [221]"
  91. 852 PRINT"[145][221]                                      [221]"
  92. 860 PRINT"[145][202][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][203]"
  93. 870 RETURN
  94. 880 OPEN15,8,15:GOSUB380:IFEF=1THEN460
  95. 890 OPEN2,8,2,"0:MEMO FILE,S,R":GOSUB380:IFEF=0THEN940
  96. 900 IFE0<>62THEN460
  97. 910 CLOSE2:OPEN2,8,2,"MEMO FILE,S,W":GOSUB380:IFEF=1THEN460
  98. 920 PRINT#2,1:PRINT#2,"M,"Y0","M0","D0",START MEMO FILE":GOSUB380:IFEF=1THEN460
  99. 930 CLOSE2:GOTO890
  100. 940 INPUT#2,NR:GOSUB380:IFEF=1THEN460
  101. 950 FORI=0TONR-1:INPUT#2,TF$(I),YF(I),MF(I),DF(I),T$(I):GOSUB380:IFEF=1THEN460
  102. 960 NEXT:CLOSE2:GOTO190
  103. 970 OPEN2,8,2,"@0:MEMO FILE,S,W":GOSUB380:IFEF=1THEN460
  104. 971 PRINT#2,NR:GOSUB380:IFEF=1THEN460
  105. 972 FORI=0TONR-1:PRINT#2,TF$(I)","YF(I)","MF(I)","DF(I)","T$(I):GOSUB380:IFEF=1THEN460
  106. 973 NEXT:CLOSE2:CLOSE15:PRINT"[147]";:END
  107. 1000 TY$="B":GOSUB160:GOSUB430
  108. 1010 I=0:J=0
  109. 1020 IFTF$(I)<>TY$THEN1140
  110. 1030 D=DF(I):M=MF(I):Y=YF(I):N$=T$(I)
  111. 1040 DN=M(M-1)+D:IFM>2THENDN=DN+LY
  112. 1050 IF(DN<L0ORDN>H0)AND(DN<L1ORDN>H1)THEN1140
  113. 1052 IFTY$<>"M"THEN1060
  114. 1053 IFDN>=L0ANDDN<=H0ANDY=Y0THEN1060
  115. 1054 IFDN>=L1ANDDN<=H1ANDY=Y0+CYTHEN1060
  116. 1055 GOTO1140
  117. 1060 J=J+1:IFTY$<>"M"THENGOSUB510:GOTO1100
  118. 1070 P$=M$(M-1)+STR$(D)
  119. 1080 IFLEN(P$)<7THENP$=P$+" ":GOTO1080
  120. 1090 GOSUB590
  121. 1100 PRINTTAB(3);P$:IFJ<8THEN1140
  122. 1110 GOSUB400:GOSUB160:J=0:IFTY$="B"THENGOSUB430:GOTO1140
  123. 1120 IFTY$="A"THENGOSUB440:GOTO1140
  124. 1130 GOSUB450
  125. 1140 I=I+1:IFI<NRTHEN1020
  126. 1150 PRINTTAB(3);"END OF DATA[144]":GOTO470
  127. 2000 TY$="A":GOSUB160:GOSUB440:GOTO1010
  128. 3000 TY$="M":GOSUB160:GOSUB450:GOTO1010
  129. 4000 TY$="B":PRINT"[147]UPDATE BIRTHDAY FILE":PRINT"********************"
  130. 4010 PRINT"EDIT EXISTING RECORDS (Y/N)?"
  131. 4020 GETA$:IFA$<>"Y"ANDA$<>"N"THEN4020
  132. 4030 IFA$="N"THENPRINT"[147]";:GOTO770
  133. 4040 I=0
  134. 4050 IFTF$(I)<>TY$THEN4120
  135. 4060 GOSUB610:GOSUB4070:GOSUB670:GOTO680
  136. 4070 PRINT"[144]DATE : ";YF(I);"-";MF(I);"-"DF(I):PRINT"EVENT: ";T$(I);""
  137. 4080 RETURN
  138. 4090 IFNR=1THEN4120
  139. 4095 IFI=NR-1THENNR=I:GOTO4120
  140. 4100 FORJ=I+1TONR-1:YF(J-1)=YF(J):TF$(J-1)=TF$(J):MF(J-1)=MF(J)
  141. 4110 DF(J-1)=DF(J):T$(J-1)=T$(J):NEXT:NR=NR-1
  142. 4120 I=I+1:IFI<NRTHEN4050
  143. 4122 GOTO760
  144. 4125 GOSUB4130:GOTO4060
  145. 4130 GOSUB700:GOSUB4070:PRINTTAB(5);YF(I):INPUT"[145]YEAR";Y
  146. 4140 IFY<>INT(Y)ORY<1583OR(TY$<>"M"ANDY>Y0)THEN4130
  147. 4150 YF(I)=Y:GOSUB700:GOSUB4070:PRINTTAB(6);MF(I):INPUT"[145]MONTH";M
  148. 4160 IFM<>INT(M)ORM<1ORM>12THEN4150
  149. 4170 MF(I)=M:GOSUB700:GOSUB4070:PRINTTAB(4);DF(I):INPUT"[145]DAY";D
  150. 4180 IFD<>INT(D)ORD<1ORD>(DM(M-1)+1)OR(M<>2ANDD>DM(M-1))THEN4170
  151. 4190 DF(I)=D:GOSUB700:GOSUB4070:PRINTTAB(6);T$(I):INPUT"[145]ITEM";T$(I):GOSUB700:GOTO4070
  152. 4200 IFNR>=100THENPRINT"RECORD ARRAY FULL!":GOTO470
  153. 4210 I=NR:YF(I)=0:TF$(I)=TY$:MF(I)=0:DF(I)=0:T$(I)="-"
  154. 4220 GOSUB820:GOSUB400:GOSUB4130:PRINT"ADD THIS RECORD ?";
  155. 4230 GETA$:IFA$<>"Y"ANDA$<>"N"THEN4230
  156. 4240 PRINTA$:PRINT:IFA$="Y"THENNR=NR+1
  157. 4250 PRINT"ANOTHER NEW RECORD ?"
  158. 4260 GETA$:IFA$<>"Y"ANDA$<>"N"THEN4260
  159. 4270 IFA$="Y"THEN4200
  160. 4280 GOTO190
  161. 5000 TY$="A":PRINT"[147]UPDATE ANNIVERSARY FILE":PRINT"***********************":GOTO4010
  162. 6000 TY$="M":PRINT"[147]UPDATE APPOINTMENT FILE":PRINT"***********************":GOTO4010
  163.